#include"commn.h"

int main()
{
  int fd = open(MY_FIFO,O_WRONLY);
  if(fd<0)
  {
    perror("open fail\n");
    return 1;
  }
  while(1)
  {
    printf("请输入#");
    fflush(stdout);
    char buffer[64]={0};
    ssize_t s = read(0,buffer,sizeof(buffer)-1);
    if(s>0)
    {
      buffer[s-1]=0;
      printf("%s\n",buffer);
      write(fd,buffer,strlen(buffer));
    }
  } 

  close(fd);
  return 0;
}
